<?php
session_start();
function security_code() {
	return substr( hexdec( md5( microtime())),2,6);
}
$_SESSION['_SECURITYCODE'] = security_code();
$securitycode = $_SESSION['_SECURITYCODE'];

$image = ImageCreateFromJPEG("themes/default/images/code_bg.jpg");
$text_color = ImageColorAllocate($image, 70, 80, 80);
Header("Content-type: image/jpeg");
ImageString ($image, 5, 12, 2, $securitycode, $text_color);
ImageJPEG($image, '', 75);
ImageDestroy($image);
die();
?>
